import urllib
import xml.etree.cElementTree as etree

class TVDB(object):
    
    __BASE_URL = "http://www.thetvdb.com/api/%s/series/%s/%s"    
    __SERIE_CODE = '79824'
    __DEFAULT_METHOD = 'all'
    
    def __init__(self, usrCode):
        self.code = usrCode
        self.baseUrl = self.__BASE_URL % (usrCode, self.__SERIE_CODE, self.__DEFAULT_METHOD)
        
    def getData(self):
        tvdbXml = urllib.urlopen(self.baseUrl)
        return etree.parse(tvdbXml)
    
        